/**
 * Created by yanxiaoyao on 2017/03/03.
 */
'use.strict';
define(['app'], function(app) {
    app.register.service("commonService", function(baserHttp) {
            return {
                //          查询三级分类
                classify: function(callback) {
                    return baserHttp.$httpPost("/search/goods/classificationlist.do", {}, callback);
                },
                //          五级搜索
                motorcycleType: function(param, callback) {
                    return baserHttp.$httpPost("/search/selectbox.do", param, callback);
                },
                //			加载oem列表
                LoadList: function(param, callback) {
                    return baserHttp.$httpPost("/search/queryOemInfoByThirdClassifyId.do", param, callback);
                },
                //oem模糊查询列表
                search: function(param, callback) {
                    return baserHttp.$httpPost('/search/inputbox.do', param, callback);
                },
                //oem模糊查询列表
                searchOEM: function(param, callback) {
                    return baserHttp.$httpPost('/search/queryOemCodeByLike.do', param, callback);
                },
                //生成询价单
                inquirySheet: function(param, callback) {
                    return baserHttp.$httpPost('/inquirylist/query.do', param, callback);
                },
                //			//根据前后左右加载oem列表
                Attribute: function(param, callback) {
                    return baserHttp.$httpPost('/search/queryOemInfoByAttribute.do', param, callback);
                },
                //判断食肉有oem
                oemcodetrue: function(param, callback) {
                    return baserHttp.$httpPost('/search/queryExistedClassfy.do', param, callback);
                },
            }
        })
        //  公用选中oem码
    app.register.service("OEMIDTRUE", function() {
        var list = {};
        var listtwo = {};
        var listthree = {};
        return {
            get: function(id) {
                return list[id];
            },
            set: function(id, v) {
                list[id] = v;
            },
            gettwo: function(id) {
                return listtwo[id];
            },
            settwo: function(id, v) {
                listtwo[id] = v;
            },
            getthree: function(id) {
                return listthree[id];
            },
            setthree: function(id, v) {
                listthree[id] = v;
            }
        }
    })
})
